package util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateTime {
	
	/**
	 * Convert current time to a String
	 * @return converted string.
	 */
	public static String DateToString()
	{
		return DateToString(new Date());
	}
	
	/** Convert data and time to string */
	public static String DateToString(java.util.Date date) {
		String dateStr = "";
		try{
			SimpleDateFormat DF = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
			dateStr = DF.format(date);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return dateStr;
	}
}
